"""
 -*- coding: utf-8-*-
 @File: my_error.py
 @Author: chen
 @time: 2023/12/10/ 10:18
"""
# from hogwartsHomework.homework_python.management.student_management import StudentManagement


class StudentError(Exception):
    def __init__(self, stu_id):
        self.id = stu_id

    def check_id(self):
        from hogwartsHomework.homework_python.management.student_management import StudentManagement
        if StudentManagement().is_exist(self.id):
            raise StudentNotFoundError
        else:
            raise StudentIsExistError


class StudentNotFoundError(StudentError):
    def __str__(self):
        return "出现异常，学生未找到"


class StudentIsExistError(StudentError):
    def __str__(self):
        return "出现异常，学生已存在"
